package com.cskaoyan.mall.service.implement;

import com.cskaoyan.mall.dao.UserDao;
import com.cskaoyan.mall.dao.implement.UserDaoImpl;
import com.cskaoyan.mall.model.bo.AdminLoginBO;
import com.cskaoyan.mall.model.sql.User;
import com.cskaoyan.mall.model.vo.OrderByStateVO;
import com.cskaoyan.mall.model.vo.UserSignUpVO;
import com.cskaoyan.mall.service.UserService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();

    @Override
    public List<User> allUser(HttpServletRequest request, HttpServletResponse response) {
        return userDao.allUser(request,response);
    }

    @Override
    public void deleteUser(String id) {
        userDao.deleteUser(id);
    }

    @Override
    public List<User> searchUser(String word) {
        return userDao.searchUser(word);
    }

    @Override
    public UserSignUpVO signup(User user) {
        return userDao.signup(user);
    }

    @Override
    public String login(AdminLoginBO userLogin) {
        return userDao.login(userLogin);
    }

    @Override
    public List<OrderByStateVO> getOrderByState(String state, String token) {
        return userDao.getOrderByState(state,token);
    }
}
